package com.qf.controller;

import com.qf.ResultVo;
import com.qf.service.CinemaInfoService;
import com.qf.service.MovieInfoService;
import com.qf.service.ScenesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 作者：Xx凯丶
 * 时间：2022/4/21 14:56
 */
@RestController
@RequestMapping("/cinemainfo")
@CrossOrigin
public class CinemaInfoController {
    @Autowired
    private CinemaInfoService cinemaInfoService;
    @Autowired
    private MovieInfoService movieInfoService;
    @Autowired
    private ScenesService scenesService;
    @RequestMapping("/searchcinemainfo")
    public ResultVo searchCinemaInfo(@RequestParam Integer cinemaId){
        return cinemaInfoService.searchCinemaInfoByCinemaId(cinemaId);
    }
    @RequestMapping("/searchmovieinfo")
    public ResultVo searchMovieInfo(Integer cinemaId){
        return movieInfoService.searchMoviesByCinemaId(cinemaId);
    }
    @RequestMapping("/searchscenesinfo")
    public ResultVo searchMovieInfo(Integer movieId,Integer cinemaId){
        return scenesService.searchScenesByMovieIdAndCinemaId(movieId,cinemaId);
    }

}
